//283
/* var moveZeroes = function (nums) {
    let j = 0
    for (let i = 0; i < nums.length; i++) {
        if (nums[i] != 0) {
            nums[j] = nums[i]
            j++
        }
    }
    for (let k = j; k < nums.length; k++) {
        nums[k] = 0
    }
    return nums
}
console.log(moveZeroes([0, 1, 0, 3, 12])); */
//349
/* var intersection = function (nums1, nums2) {
    //交集
    let newArr = []
    nums1.forEach(item => {
        if (nums2.includes(item)) {
            newArr.push(item)
        }
    });
    //并集
    // let newArr=nums1.concat(nums2)
    return [...new Set(newArr)]
}
// console.log(intersection([1, 2, 2, 1], [2, 2]));
console.log(intersection([4, 9, 5], [9, 4, 9, 8, 4])); */
//